package com.itheima.entry;

import com.itheima.controller.BaseStudentController;
import com.itheima.controller.OtherStudentController;
import com.itheima.controller.StudentController;
import com.itheima.controller.TeacherController;
import com.itheima.factory.StudentFactory;

import java.util.Scanner;

public class SystemEntry {
    //系统的入口 main方法
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //死循环
        loop:
        while (true) {
            System.out.println("--------欢迎来到黑马信息管理系统--------");
            System.out.println("请输入您的选择: 1.学生管理  2.老师管理  3.退出");
            //键盘录入
            String choice = sc.nextLine();
            // switch
            switch (choice) {
                case "1":
                    BaseStudentController studentController = StudentFactory.getStudentController();
                    studentController.start();
                    break;
                case "2":
                    TeacherController teacherController = new TeacherController();
                    teacherController.start();
                    break;
                case "3":
                    System.out.println("再见");
                    //break loop;
                    //return;
                    System.exit(0);//直接关闭正在运行的虚拟机
                default:
                    System.out.println("输入有误");
                    break;
            }
        }

    }
}
